<?php
class Accept extends CI_Controller {
	public function __construct() {
		parent::__construct ();
		
		// 登录校验
		$this->common->check_login_admin ();
		$this->load->helper ( array (
				'form',
				'url' ,
				'system'
		) );
		
		$this->load->model ( 'Order_Admin_model' );
	}
	
	/**
	 * 取得帮助
	 */
	public function index($page=1) {
		/*
		// var_dump($this->user_info);
		$data ['order_type'] = array (
				'静态钱包',
				'推广钱包' 
		);
		$data ['dakuan_type'] = array (
				'未打款',
				'已经打款',
				'拒绝打款' 
		);
		
		$perpage=1;
		
		if($page==0){
			$page=1;
		}
		
		
		$data ['log_list'] = $this->order_model->accept_order_log_list_all ($page,$perpage);
		
		$data['data_count']=$this->order_model->accept_order_log_list_all_count ();
			
		
		$data['multi']=multi($data['data_count'],$perpage,$page,site_url('admin/accept/index/?'),'?');
		
		
		$data ['left'] = $this->load->view ( 'admin/left', '', TRUE );
		$data ['menu'] = $this->load->view ( 'admin/menu', '', TRUE );
		
		$this->load->view ( 'admin/accept', $data, FALSE );
		//$this->load->view ( 'admin/accept/index/'.$page, $data, FALSE );

		 */
	}
	
	function doyxflag($type,$id) {
		if(empty($type) || empty($id))
		{
			exit($this->common->alert_msg_goback('参数错误'));
		}
		if($type == 1)
			{
				
				$this->Order_Admin_model->update_accept_yxflag('1',$id);
				exit($this->common->alert_msg_url('已优先',site_url('admin/accept/accept')));
			}
			else
			{
				$this->Order_Admin_model->update_accept_yxflag('0',$id);
				exit($this->common->alert_msg_url('已恢复',site_url('admin/accept/accept')));
			}
	}
	
	public function accept($page=1) {
		// var_dump($this->user_info);
		$data ['order_type'] = array (
				'静态钱包',
				'推广钱包'
		);
		$data ['dakuan_type'] = array (
				'未打款',
				'已经打款',
				'拒绝打款'
		);
		
		$perpage=10;
		
		if($page==0){
			$page=1;
		}
		
		$this->load->model ( 'user_model' );
		$this->load->model ( 'order_model' );
		$data ['log_list'] = $this->Order_Admin_model->accept_order_log_list_all ($page,$perpage);
		
		$data['data_count']=$this->Order_Admin_model->accept_order_log_list_all_count ();
			
		
		$data['multi']=multi($data['data_count'],$perpage,$page,site_url('admin/accept/accept/?'),'?');
		
		
		$data ['left'] = $this->load->view ( 'admin/left', '', TRUE );
		$data ['menu'] = $this->load->view ( 'admin/menu', '', TRUE );
		
		$this->load->view ( 'admin/accept', $data, FALSE );
		//$this->load->view ( 'admin/accept/index/'.$page, $data, FALSE );
		
	}
	
}